package com.zhou.JavaAndroidFirm.fragment;

import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.zhou.JavaAndroidFirm.R;
import com.zhou.JavaAndroidFirm.activity.AboutActivity;
import com.zhou.JavaAndroidFirm.activity.CircleZoneActivity;
import com.zhou.JavaAndroidFirm.base.BaseFragment;
import com.zhou.JavaAndroidFirm.utils.ImageLoaderUtils;
import com.zhou.JavaAndroidFirm.widget.WaveView;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * @author Administrator
 * @date 2018/7/15 0015
 * @des
 */
public class CareMainFragment extends BaseFragment {
    @BindView(R.id.wave_view)
    WaveView waveView;
    @BindView(R.id.img_logo)
    ImageView imgLogo;
    @BindView(R.id.ll_friend_zone)
    LinearLayout llFriendZone;

    @Override
    protected void lazyFetchData() {

    }

    @Override
    protected int getLayoutId() {
        return R.layout.fra_care_main;
    }

    @Override
    protected void initPresenter() {
        ImageLoaderUtils.displayRound(mContext, imgLogo, R.drawable.bgkobe);
        final FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(-2, -2);
        lp.gravity = Gravity.CENTER;
        waveView.setOnWaveAnimationListener(new WaveView.OnWaveAnimationListener() {
            @Override
            public void OnWaveAnimation(float y) {
                lp.setMargins(0, 0, 0, (int) y + 2);
                imgLogo.setLayoutParams(lp);
            }
        });
    }

    @Override
    protected void initView(Bundle bundle) {

    }

    @Override
    protected void initEvent() {

    }


    @OnClick({R.id.ll_friend_zone, R.id.ll_daynight_about})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.ll_friend_zone:
                CircleZoneActivity.startAction(mContext);
                break;
            case R.id.ll_daynight_about:
                AboutActivity.startAction(mContext);
                break;
            default:
                break;
        }


    }

}
